import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout/Index.vue'
import Login from '@/views/login/Index.vue'
import Home from '@/views/home/Home.vue'
import Pro from '@/views/product/product.vue'
import List from '@/views/product/list/list.vue'
const FenLei = ()=>import('@/views/product/fenlei/Fenlei.vue')
const Order = ()=>import('@/views/order/Order.vue')
const Orderlist =()=>import('@/views/order/orderlist/Orderlist.vue')
const Allorder =()=>import('@/views/order/allorder/Allorder.vue')

Vue.use(VueRouter)
const routes = [
 {
    path:'/',
    component:Layout,
    children:[
      {
         path:'/',
         component:Home
      },
      {
         path:'/pro',
         component:Pro,
         children:[
            {
               path:'list',
               component:List
            },
            {
               path:'fenlei',
               component:FenLei
            }
         ]
      },{
         path:'/order',
         component:Order,
         children:[
          {
            path:'list',
            component:Orderlist
          },{
            path:'allorder',
            component:Allorder
          }
         ]
      }
    ]
 },{
    path:'/login',
    name:'login',
    component:Login
 }
]
const router = new VueRouter({
    mode:'history',
    base: process.env.BASE_URL,
    routes

})
 export default router